<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>找出数组内最⼤的素数</title>
</head>
<body>
    <script>
        // 质数是除了1和它自身外，不能被其它自然数整除的数
        var arr = [2,3,5,7,11,13,15,17,19];
        var name = arr[0];
        for(var i = 0;i < arr.length;i++){
            if(arr[i] > name){
                name = arr[i];
            }
        }
        console.log('数组中最大素数为:' + name)
    </script>
</body>
</html>